package nodes

import (
	"gitee.com/zfd81/dbrs/sql"
	"vitess.io/vitess/go/sqltypes"
)

type ShowCollation struct {
}

func NewShowCollation() *ShowCollation {
	return &ShowCollation{}
}

// Resolved implements sql.Node interface. The function always returns true.
func (sc *ShowCollation) Resolved() bool {
	return true
}

func (sc *ShowCollation) String() string {
	return "ShowCollation"
}

// Note how this Schema differs in order from the information_schema.character_sets table.
func (sc *ShowCollation) Schema() sql.Schema {
	return sql.Schema{
		{Name: "collation", Type: sqltypes.VarChar, Default: sqltypes.NULL, Nullable: false},
		{Name: "charset", Type: sqltypes.VarChar, Default: sqltypes.NULL, Nullable: false},
		{Name: "id", Type: sqltypes.VarChar, Default: sqltypes.NULL, Nullable: false},
		{Name: "default", Type: sqltypes.Uint8, Default: sqltypes.NULL, Nullable: false},
		{Name: "compiled", Type: sqltypes.VarChar, Default: sqltypes.NULL, Nullable: false},
		{Name: "sortlen", Type: sqltypes.VarChar, Default: sqltypes.NULL, Nullable: false},
		{Name: "pad_attribute", Type: sqltypes.Uint8, Default: sqltypes.NULL, Nullable: false},
	}
}
